package com.cqc.kafka;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

/**
 * @author cui
 * @date 2025/5/14 22:36
 * @description
 **/

@Component
public class KafkaUtil {


    @Autowired
    private KafkaTemplate<String, String> kafkaTemplate;


    public void send(String topic, String message) {
        kafkaTemplate.send(topic, message);
    }

    public void send(String topic, String Key, String message) {
        kafkaTemplate.send(topic, Key, message);
    }
}
